<?php $i=0; foreach ($invoice as $invoice1){?>
<tr id="tr_<?php echo $invoice1['invoice_no'];?>" >
                <!--onclick="javascript:invoDet(
                        '#invo_<?php echo $invoice1['invoice_id'];?>', '#placeResult', 
                        '<?php echo $invoice1['invoice_id'];?>', '0')"-->
                        <td><input type="checkbox" name="invoviewcheck[]" id="invoviewcheck[]"  value="<?php echo $invoice1['invoice_no']?>"/></td>
                        <td id="td_<?php echo $invoice1['invoice_no'];?>"><?php echo $invoice1['invoice_no'];?></td> 
                        <td><?php echo $invoice1['pt_name'];?></td>
                        <td><?php echo $invoice1['customer_name'];?></td>
                        <td><?php echo $invoice1['tglBayar'];?></td>  
                        <td><?php echo $invoice1['paymethod'];?></td> 
                        <input type="text" value="<?php echo $invoice1['total'];?>" id="tagihan_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                        <input type="text" value="<?php echo $invoice1['paymethod'];?>" id="method_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                        <input type="text" value="<?php echo $invoice1['tglBayar'];?>" id="tanggal_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                        <input type="text" value="<?php echo $invoice1['pt_name'];?>" id="perusahaan_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                        <input type="text" value="<?php echo $invoice1['duedate'];?>" id="due_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                        <input type="text" value="<?php echo $invoice1['bayar'];?>" id="bayar_<?php echo  $invoice1['invoice_no'];?>" style="display:none" />
                      
                        <td><?php 
                            if	($invoice1['status']=="Belum Bayar"){
                                    ?><div id="div_<?php echo $invoice1['invoice_no'];?>" class="ajaxbayar" style="cursor:pointer"><font color="#FF0000">Belum Bayar</font></div>
                                <?php } else if($invoice1['status']=="Belum Lunas"){ ?>
                                    <div id="div_<?php echo $invoice1['invoice_no'];?>" class="ajaxbayar" style="cursor:pointer"><font color="#FF9900">Belum Lunas</font></div> <?php
                                }else{?>
									<div id="div_<?php echo $invoice1['invoice_no'];?>" class="ajaxbayar" style="cursor:pointer"><font color="#00CC33">Lunas</font></div>
								<?php }?>
                        </td>
                        <td><?php 
                            if	($invoice1['status']=="Lunas"){
                                    ?><font color="#00FF33">Lunas</font>
                                <?php } else{ ?>
                                	<?php if($invoice1['due']=="Terlambat"){?>
										<font color="#FF0000">Terlambat</font>
									<?php }else{ ?>
                                    	<font color="#00FF00">Belum Terlambat</font>
									<?php }?>
								<?php }?>
                        </td> 
                       
                        <td><a href="">View & Edit</a></td>
                    </tr> 
                    
                    	<?php $i++;} ?>